-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Replaced field_masking_span occurrences with respective ParseField #74718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@elasticmachine retest this please |
1 similar comment
@elasticmachine retest this please |
@elasticmachine test this pleasee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this pull request @GrayFox1! I left a couple of comments but this looks pretty close to me.
@@ -110,7 +110,7 @@ public static FieldMaskingSpanQueryBuilder fromXContent(XContentParser parser) t | |||
throw new ParsingException(parser.getTokenLocation(), "[field_masking_span] query must be of type span query"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace the name in these error messages as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, i'll fix those messages in my next commit
@@ -73,13 +74,13 @@ public void testFromJson() throws IOException { | |||
"}"; | |||
Exception exception = expectThrows(ParsingException.class, () -> parseQuery(json)); | |||
assertThat(exception.getMessage(), | |||
equalTo("field_masking_span [query] as a nested span clause can't have non-default boost value [0.23]")); | |||
equalTo(NAME.getPreferredName() + " [query] as a nested span clause can't have non-default boost value [0.23]")); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a test that uses the old deprecated name, and checks for a deprecation warning? There's an assertWarnings()
helper method that will check for specific deprecation strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, i'll add a new test in my next commit.
@elasticmachine test this please |
There's a failure in |
Thanks for your feedback @romseygeek! I just updated my pull request according to your comments and ran all tests with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @GrayFox1, this looks great. Two more nits and then I think we're done, as long as CI is happy.
.idea/eclipseCodeFormatter.xml
Outdated
@@ -11,4 +11,4 @@ | |||
</ProjectSpecificProfile> | |||
</option> | |||
</component> | |||
</project> | |||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you revert this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, i guess this happened when i was trying to configure the eclipseCodeFormatter plugin, but i'll revert this in my next commit.
@@ -303,7 +304,7 @@ public void testRegisterRescorer() { | |||
"combined_fields", | |||
"dis_max", | |||
"exists", | |||
"field_masking_span", | |||
NAME.getPreferredName(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just use "span_field_masking" here to keep in line with the other entries in the list.
@elasticmachine test this please |
@GrayFox1 you'll need to merge in the latest version of our master branch to get tests to pass (we've had a version bump internally so all the BWC checks are complaining). |
Pinging @elastic/es-search (Team:Search) |
Thanks @romseygeek! I just updated my pull request according to your comments, ran the tests with There is only one test failing when i ran I tried looking into the SearchModule to check if the QuerySpec Registration wasn't using the ParseField, but everything looks ok. |
@elasticmachine test this please |
Aha, this looks like it's a bug in the test - it's filtering out queries that have any deprecated names, not queries that have been entirely deprecated. I'll open a separate fix for that. |
I opened #74906 to fix the search test issue - you can merge that in here first as well if you like so that we can see how happy CI is otherwise. |
@elasticmachine update branch |
@elasticmachine ok to test |
Thanks @GrayFox1! |
💔 Backport failed
To backport manually run: |
`field_masking_span` is the only span query that does not begin with `span_`. This commit deprecates the existing name and adds a new name `span_field_masking` to better fit with the other queries.
Manually backported in fc5b80a |
Closes #63527.
Replaced field_masking_span occurrences with respective ParseField. This change improves maintainability, since some hard coded Strings were replaced by the ParseField that i've defined in the FieldMaskingSpanQueryBuilder Class, besides being consistent with other span queries.
I've ran the tests with "gradlew :server:test --tests org.elasticsearch.index.*" and i would appreciate if someone could give me some feedback.